// import log from '@dfeidao/atom-nodejs/logger/log';
import { IncomingHttpHeaders } from 'http';
import operate from '@dfeidao/atom-nodejs/db/operate';

import { systemid, productid } from '../../atom/config';
interface Message {
	data: {
		event_no: string;
		event_location: string;
		event_record: string;
		process_result: string;
		cause_analysis: string;
		precaution: string;
		principal_opinion: string;
		memo: string;
		event_theme: string;
		resume_attachment: string;
		principal_part: string;
		management_office: string;
		event_time: string;
	}
}


export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	// log('Service begin path:e:\7.29考核\kh\src\LiQiuLiang\zj-000007\s002,action_id:' + action_id);

	const { exec, update } = operate(action_id, session_id, systemid);
	update('burst_event', { productid, event_no: message.data.event_no }, {
		event_theme: message.data.event_theme,
		event_location: message.data.event_location,
		event_record: message.data.event_record,
		process_result: message.data.process_result,
		cause_analysis: message.data.cause_analysis,
		precaution: message.data.precaution,
		principal_opinion: message.data.principal_opinion,
		memo: message.data.memo,
		resume_attachment: message.data.resume_attachment,
		principal_part: message.data.principal_part,
		management_office: message.data.management_office,
		event_time: message.data.event_time
	});



	const r = await exec();


	// log('Service end path:e:\7.29考核\kh\src\LiQiuLiang\zj-000007\s002,action_id:' + action_id);
	return r
}
